﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ThinhTien.Data;

namespace ThinhTien.Controllers
{
    public class HomeController : Controller
    {
        private HomeRepository home = new HomeRepository();

        public ActionResult Index()
        {
            ViewData["MainMenu"] = "style=\"display: block; width:202px;\"";
            Session["HomeViewModel"] = home.GetDataForHomepage();
            return View();
        }

        //public ActionResult Index(string name, int id)
        //{
        //    ViewData["MainMenu"] = "style=\"display: block; width:202px;\"";

        //    var model = home.GetDataForHomepage();
        //    // permanently redirect to the correct URL
        //    if (name != "trangchu" || id != 1)
        //    {
        //        return RedirectToActionPermanent("Index", "Home", new { name = "trangchu", id = 1 });
        //    }

        //    return View(model);
        //}

        public ActionResult About()
        {
            ViewBag.Message = "Your app description page.";

            return View();
        }

        public ActionResult Contact()
        {
            ViewBag.Message = "Your contact page.";

            return View();
        }

        public ActionResult Product_Detail()
        {
            return View();
        }
    }
}
